package com.gxa.park.core.pojo.domain;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Component;

/**
 * <p>
 * 
 * </p>
 *
 * @author mincheung
 * @since 2022-07-18
 */
@TableName("tb_admin")
@ApiModel(value = "Admin对象", description = "")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Admin implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("自增id")
    @TableId(value = "ad_id", type = IdType.AUTO)
    private Integer adId;

    @ApiModelProperty("管理员名称")
    @TableField("ad_username")
    private String adUsername;

    @ApiModelProperty("邮件")
    @TableField("ad_email")
    private String adEmail;

    @ApiModelProperty("手机号")
    @TableField("ad_phone")
    private String adPhone;

    @ApiModelProperty(value = "密码",hidden = true)
    @TableField("ad_password")
    @JsonIgnore
    private String adPassword;

    @ApiModelProperty("加盐")
    @TableField("ad_salt")
    private String adSalt;

    @ApiModelProperty("是否启用")
    @TableField("ad_is_enable")
    private Boolean adIsEnable;

    @ApiModelProperty("上次登录的时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @TableField("ad_last_login_time")
    private LocalDateTime adLastLoginTime;

    @ApiModelProperty("逻辑删除")
    @TableField("ad_delete")
    @TableLogic
    private Boolean adDelete;

}
